{extend name='main'}

{block name="button"}
<!--{if auth("add")}-->
<button data-modal='{:url("add")}' data-title="添加用户" class='layui-btn layui-btn-sm layui-btn-primary'>添加用户</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-shadow">
    <div class="layui-tab-content">
        {include file='staff/search'}
        <table id="BaseData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
    </div>
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th width="" class='text-center nowrap'>ID</th>
            <th width="" class='text-center nowrap'>头像</th>
            <th width="" class='text-center nowrap'>用户昵称</th>
            <th width="" class='text-center nowrap'>用户账号</th>
            <th width="" class='text-center nowrap'>姓名</th>
            <th width="" class='text-center nowrap'>绑定手机号</th>
            <th width="" class='text-center nowrap'>类型</th>
            <th width="" class='text-center nowrap'>公司</th>
            <th width="" class='text-center nowrap'>部门</th>
            <th width="" class='text-center nowrap'>岗位</th>
            <th width="" class='text-center nowrap'>工号</th>
            <th width="" class='text-center nowrap'>状态</th>
            <th width="" class='text-center nowrap'>最后一次登录ip</th>
            <th width="" class='text-center nowrap'>最后一次登录时间</th>
            <th width="" class='text-center nowrap'>添加时间</th>
            <th width="" class='text-center nowrap'>操作时间</th>
            <th width="" class='text-center nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
            </td>
            <td class="text-center nowrap">{$vo.id|default=""}</td>
            <td class="text-center nowrap">
                <img width="120" height="100" src='{$vo.avatar|default=""}' alt=""/>
            </td>
            <td class="text-center nowrap" style="font-weight: bold; color: #0C0C0C">{$vo.nickname|default=""}</td>
            <td class="text-center nowrap">{$vo.username|default=""}</td>
            <td class="text-center nowrap" style="font-weight: 600; color: #666666">{$vo.name|default=""}</td>
            <td class="text-center nowrap" style="font-weight: 600; color: #666666">{$vo.phone|default=""}</td>
            <td class="text-center nowrap">{$vo.type|getStaffType}</td>
            <td class="text-center nowrap">{$vo.company|default="-"}</td>
            <td class="text-center nowrap">{$vo.depart|default="-"}</td>
            <td class="text-center nowrap">{$vo.post|default="-"}</td>
            <td class="text-center nowrap">{$vo.job_no|default="-"}</td>
            <td class="text-center nowrap">
                {eq name='vo.is_deleted' value='0'}<span class="layui-badge layui-bg-green">正常</span>{else}<span
                    class="layui-badge">已注销</span>{/eq}
            </td>

            <td class="text-center nowrap">{$vo.login_ip|default="-"}</td>
            <td class="text-center nowrap">{$vo.login_time|date="Y-m-d H:i:s"}</td>
            <td class="text-center nowrap">{$vo.create_time|date="Y-m-d H:i:s"}</td>
            <td class="text-center nowrap">{$vo.update_time|date="Y-m-d H:i:s"}</td>
            <td class="text-center nowrap">

                <!--{if auth('edit')}-->
                <a class="layui-btn layui-btn-sm" data-modal="{:url('edit')}?id={$vo.id}" data-title="编辑"
                   data-dbclick data-value="id#{$vo.id}" data-csrf="{:systoken('edit')}">编辑</a>
                <!--{/if}-->

                <!--{if auth('pass')}-->
                <a class="layui-btn layui-btn-sm layui-bg-blue" data-modal="{:url('pass')}?id={$vo.id}" data-title="密码"
                   data-dbclick data-value="id#{$vo.id}" data-csrf="{:systoken('pass')}">密码</a>
                <!--{/if}-->


                <!--{if auth("remove")}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}"
                   data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" data-confirm="确定要注销该项吗？">注 销</a>
                <!--{/if}-->

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>

{/block}